package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Bizlogic.CAManager;
import DAO.DAOException;
import DAO.EmployeeDAO;
import DAO.ProductsDAO;
import DAO.MySQL.EmployeeDAOImpl;
import DAO.MySQL.ProductsDAOImpl;
import Model.Employee;
import Model.Product;

/**
 * @author TONY
 *
 */
public class EditProduct extends HttpServlet {

	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		String pronum =request.getParameter("productnum");
		CAManager ca= new CAManager();
		
        //ProductsDAO pd=new ProductsDAOImpl();
        Product pro=null;
        try {
			pro=ca.findProduct(Integer.parseInt(pronum));
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		request.setAttribute("product", pro);
		request.getRequestDispatcher("EditPro.jsp").forward(request, response);
	}



}
